import json
import requests

def get_order_list():
    with open('订单.txt','r', encoding='utf-8') as f:
        input_string = f.read()
    order_list = json.loads(input_string)
    print(order_list)
    return order_list

def request_get():
    url = r'http://192.168.16.240:8001/api/customerservice/DamagedOrders/GetDamagedOrdersZrImgTaskList?taskState=3&pageSize=1000&pt=2'
    response = requests.get(url)
    # 检查响应状态码
    if response.status_code == 200:
        print('GET请求成功')
        rsp= response.json()  # 如果响应是JSON格式，可以使用json()方法解析
        data = rsp['data']['list']
        # 使用字典将相同的 shopName 数据分组
        grouped_data = {}
        for entry in data:
            shop_name = entry['shopName']
            if shop_name not in grouped_data:
                grouped_data[shop_name] = []
            grouped_data[shop_name].append(entry)
        # 输出结果
        return grouped_data
    else:
        print(f'GET请求失败，状态码: {response.status_code}')